package cn.edu.sdjzu.xg23.kcsj01_backend.mapper;


import cn.edu.sdjzu.xg23.kcsj01_backend.entity.Employee;
import cn.edu.sdjzu.xg23.kcsj01_backend.entity.EmployeeAssPatent;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EmployeeAssPatentMapper {
    // 根据专利id查询所有申报人
    List<EmployeeAssPatent> getApplicantsByPatentId(Long patentId);
    // 根据专利id查询第一申报人
    Employee getFirstApplicantByPatentId(Long patentId);
    // 批量插入
    boolean insertApplicants(@Param("list") List<EmployeeAssPatent> list);

    @Delete("DELETE FROM employee_patent WHERE patent_id = #{patentId}")
    int deleteByPatentId(Long patentId);
}
